package classes
{
	public class Trends
	{
		private static const TABLE:String = "trends";

		public static function Add(userid:String,resturantid:String,resturantname:String,checkintime:String):void{
			try{
				var insertObj:Object = new Object();
				insertObj.userid = userid;
				insertObj.resturantid = resturantid;
				insertObj.resturantname = resturantname;
				insertObj.checkintime = checkintime;

				DatabaseManager.Manager.Insert(TABLE,insertObj);
			}catch(err:Error){
				throw err;
			}
		}

		public static function List(condition:String = ""):Array{
			try{
				return DatabaseManager.Manager.Select(TABLE,null,condition,"userid");
			}catch(err:Error){
				throw err;
			}
			return new Array;
		}
		
		public static function Delete(condition:String = ""):void{
			try{
				DatabaseManager.Manager.Delete(TABLE,condition);
			}catch(err:Error){
				throw err;
			}
		}	
	}
}